package com.demo.controller;

import org.springframework.web.HttpRequestHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class HttpController implements HttpRequestHandler {
    @Override
    public void handleRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //给页面返回一个值
        request.setAttribute("hello","我是李四");
        request.getRequestDispatcher("/WEB-INF/jsps/index.jsp").forward(request,response);
    }
}
